<template>
	<z-paging ref="paging" bgColor="#F5F6FA"  class="content" v-model="dataList" @query="queryList">
		<view class="list-box">
			<view class="item"  @click="goDetails(item.id)" v-for="(item,index) in dataList">
				<view class="left">
					<view class="h1">
						{{item.title}}
						
					</view>
					<view class="p">
						{{item.add_time}}
					</view>
				</view>
				<view class="right" :class="{on:item.pm==1}">
					{{item.pm?'+':"-"}}{{item.number}}
				</view>
			</view>
		</view>
	</z-paging>
</template>

<script setup>
	import {ref} from "vue"
	import {spreadCommission} from "@/api/user.js"
	import {onShow} from "@dcloudio/uni-app"
	const paging=ref(null)
	const dataList=ref([])
	const queryList=async (pageNo, pageSize)=>{
		let res=[]
		try {
			let re=await spreadCommission({params:{page:pageNo,limit:pageSize}})
			res=re.data.list
		} finally {
			//TODO handle the exception
			paging.value.complete(res);
		}
	}

</script>

<style lang="scss">
	page{
		background: #F5F6FA;
	}
	.item{
		padding: 28rpx;
		background-color: #fff;
		position: relative;
		display: flex;
		justify-content: space-between;
		align-items: center;
		margin-bottom: 20rpx;
		.right{
			font-size: 36rpx;
			font-weight: bold;
			color:#FF9B46;
			&.on{
				color:#16ac57;
			}
		}
		.h1{
			font-size: 30rpx;
			display: flex;
			justify-content: space-between;
			align-items: center;
			.h{
				display: flex;
				align-items: center;
				.no-look {
					width: 10rpx;
					height: 10rpx;
					border-radius: 50%;
					background-color: #1ABB1D;
					margin-right: 10rpx;
				}
			}
			.time{
				font-size: 24rpx;
				color:#aaa;
			}
		}
		.p{
			font-size: 26rpx;
			margin-top:8rpx;
			color:#aaa;
			white-space: nowrap; /* 防止文本换行 */
			  overflow: hidden; /* 隐藏溢出的文本 */
			  text-overflow: ellipsis; /* 显示省略号 */
		}
	}
</style>
